package com.clgc.oss.controller;

import com.clgc.oss.service.OssService;
import com.clgc.oss.service.TestMu;
import com.clgc.utils.R;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.io.FileNotFoundException;

/**
 * @author lsr
 * @create 2021-03-24-21:30
 */
@Api("用户上传头像管理")
@RestController
@CrossOrigin
@RequestMapping("/oss/fileserver")
public class OssController {

    @Autowired
    OssService ossService;

    @Autowired
    TestMu testMu;


    @PostMapping("uploadOssFile")
    public R uploadOssFile(MultipartFile file){
        System.out.println("**********"+file);
//        String url=ossService.uploadOssFile(file);
        try {
            testMu.sc();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }

        return R.ok();
    }
}
